<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Ajax--实现步骤</title>
    <script src="js/jquery-3.7.1.js"></script>
</head>
<body>
    <h1>Ajax-实现异步请求</h1>
    <button id="btn1">方法11111</button>
    <button id="btn">方法2222222</button>
    <p>结果:<span id="js"></span></p>
    <script>
        $("#btn1").click(function (){
            $.ajax("send.do",{
                type:"post",
                data:"name=zs&age=18",
                success:function (data){
                    $("#js").text(data);
                },
            });
        });
        $("#btn").click(function (){
            $.ajax("send.do",{
                data:{
                    name :'qi',
                    age : '16',
                },
                success:function (data){
                    $("#js").text(data);
                },
            });
        });
    </script>
</body>
</html>